Blockly.Blocks['Keep_left_goal'] = {
  init: function () {
    this.jsonInit({
      type: "Keep_left_goal",
      message0: "%{BKY_KEEP_LEFT_GOAL}",
      previousStatement: null,
      nextStatement: null,
      colour: "#7148F5",
      toolip: "",
      helpUrl: ""
    });
  }
};

Blockly.Lua['Keep_left_goal'] = function (block) {
  const code = [
    "MOTOrigid16(60,60,60,70,70,70,70,70,60,60,60,70,70,70,70,70)",
    "MOTOsetspeed(55)",
    "MOTOmove16(91, 75, 101, 92, 145, 153, 74, 103, 75, 57, 100, 105, 114, 161, 71, 113)",
    "MOTOwait()",
    "DelayMs(200)",
    "MOTOsetspeed(45)",
    "MOTOmove16(95, 177, 97, 95, 118, 151, 54, 122, 103, 29, 100, 94, 122, 161, 74, 113)",
    "MOTOwait()",
    "DelayMs(1500)",
    "MOTOsetspeed(150)",
    "MOTOmove16(167, 85, 95, 95, 118, 151, 54, 122, 103, 29, 100, 94, 122, 161, 74, 113)",
    "MOTOwait()",
    "MOTOmove16(16, 129, 90, 95, 118, 151, 54, 122, 103, 29, 100, 94, 122, 161, 74, 113)",
    "MOTOwait()",
    "MOTOmove16(16, 129, 90, 73, 116, 152, 55, 122, 103, 29, 100, 94, 122, 161, 74, 113)",
    "MOTOwait()",
    "MOTOsetspeed(150)",
    "MOTOmove16(92, 50, 101, 77, 127, 148, 58, 111, 103, 29, 100, 94, 111, 134, 85, 132)",
    "MOTOwait()",
    "DelayMs(100)",
    "MOTOsetspeed(20)",
    "MOTOmove16(92, 50, 101, 101, 131, 148, 65, 102, 103, 29, 100, 102, 66, 49, 134, 100)",
    "MOTOwait()",
    "MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)",
    "MOTOwait()",
    ""
  ];
  return code.join("\n");
}

